package com.kristin.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @ClassName AnnotationTest
 * @Description TODO
 * @Author Kristin
 * @Date 2020/09/02 11:16:07
 * @Version 1.0.0
 */
public class AnnotationTest {

    public static void main(String[] args) {
    }


}

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.FIELD})
@interface AutoFillIn {

    String value();

    Bean bean() default @Bean(beanName = "123");

}


@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@interface Bean{

    String beanName();

}


@Bean(beanName = "student")
class Car {

    @AutoFillIn("Wheels")
    private Wheels wheels;

    private String name;

    private Integer age;

}

@Bean(beanName = "wheel")
class Wheels {

    private String type;

}